﻿package cn.bdqn.dao.user;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.bdqn.pojo.User;

public interface UserMapper {
	public List<User> getUserList1();
	/**
	 * 增加用户信息
	 * 
	 * @param connection
	 * @param user
	 * @return @
	 */
	public boolean addUser(User user);

	/**
	 * 通过userCode获取User
	 * 
	 * @param connection
	 * @param userCode
	 * @return @
	 */
	public User getLoginUser(@Param("userCode") String userCode,
			@Param("userPassword") String userPassword);

	/**
	 * 通过条件查询-userList
	 * 
	 * @param connection
	 * @param userName
	 * @param userRole
	 * @return @
	 */
	public List<User> getUserList(@Param("userName") String userName,
			@Param("userRole") Integer userRole,
			@Param("form") Integer currentPageNo,
			@Param("pageSize") Integer pageSize);

	/**
	 * 通过条件查询-用户表记录数
	 * 
	 * @param connection
	 * @param userName
	 * @param userRole
	 * @return @
	 */
	public int getUserCount(@Param("userName") String userName,
			@Param("userRole") int userRole);

	/**
	 * 通过userId删除user
	 * 
	 * @param delId
	 * @return @
	 */
	public boolean deleteUserById(Integer delId);

	/**
	 * 通过userId获取user
	 * 
	 * @param connection
	 * @param id
	 * @return @
	 */
	public User getUserById(String id);

	/**
	 * 修改用户信息
	 * 
	 * @param connection
	 * @param user
	 * @return @
	 */
	public boolean modifyUser(User user);

	/**
	 * 修改当前用户密码
	 * 
	 * @param connection
	 * @param id
	 * @param pwd
	 * @return @
	 */
	public boolean updatePwd(@Param("id") int id, @Param("pwd") String pwd);

	/**
	 * 根据userCode查询出User
	 * 
	 * @param userCode
	 * @return
	 */
	public User selectUserCodeExist(String userCode);
	public User selectUserNameExist(String userName);

}
